#include "Thread.h"

Thread::Thread(ThreadFunction threadFunc) :
    threadFunction_(std::move(threadFunc))
{
    
}

Thread::~Thread() {
    
}

void Thread::start() {
    pthread_create(&tid_, NULL, startThread, this);
}

void* Thread::startThread(void* param) {
    Thread* p = (Thread*)param;
    p->threadFunction_();
}

void Thread::join() {
    pthread_join(tid_, NULL);
}
